Add FlexMeasures-Version and API-Version response headers#2021
Add FlexMeasures-Version and API-Version response headers#2021
Conversation
Documentation build overview
Show files changed (4 files in total): 📝 4 modified | ➕ 0 added | ➖ 0 deleted
|
|
I suggest using the dedicated So maybe: |
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
|
Signed-off-by: F.N. Claessen <claessen@seita.nl>
That might be true. FlexMeasures can be considered to not be the server. Another thing I'd like in this PR is to mention this setting in the documentation which talks about the API, maybe below the Authentication section. |
|
@copilot a few follow-ups:
|
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Done in commit 391e59f — added documentation about the new version headers at the end of the "Main endpoint and API versions" section.
Done in commit 391e59f:
The |
Clients have no programmatic way to identify the server version or API version from HTTP responses alone.
Changes
flexmeasures/api/__init__.py: Registers anapp.after_requesthook inregister_at()that injects version headers based on request path prefix:FlexMeasures-Version: <version>on all responses under/api/API-Version: v3_0additionally on all responses under/api/v3_0flexmeasures/api/tests/test_headers.py: New test file covering header presence on v3_0 and non-v3_0 API endpoints, and absence ofAPI-Versionon non-v3_0 endpoints.documentation/api/introduction.rst: Added description of the new response headers at the end of the "Main endpoint and API versions" section; removed an outdated note from that section.documentation/api/change_log.rst: Added entries underv3.0-30documenting the newFlexMeasures-VersionandAPI-Versionresponse headers.Example
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.